package org.dreamfly.netshop.entity;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * Class entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Class")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Type implements java.io.Serializable {

    // Fields
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(name = "classname")
    private String className;
    @Column(name = "categoryurl")
    private String categoryUrl;

    @OneToMany(targetEntity = GoodsInfo.class, mappedBy = "type")
    private Set<GoodsInfo> goodsInfos = new LinkedHashSet<GoodsInfo>(0);

    @OneToMany(targetEntity = ShipType.class, mappedBy = "type")
    private Set<ShipType> shipTypes = new LinkedHashSet<ShipType>(0);

    // Constructors

    /** default constructor */
    public Type() {
    }

    /** full constructor */
    public Type(String className, String categoryUrl, Set<GoodsInfo> goodsInfos, Set<ShipType> shipTypes) {
        this.className = className;
        this.categoryUrl = categoryUrl;
        this.goodsInfos = goodsInfos;
        this.shipTypes = shipTypes;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getCategoryUrl() {
        return categoryUrl;
    }

    public void setCategoryUrl(String categoryUrl) {
        this.categoryUrl = categoryUrl;
    }

    public Set<GoodsInfo> getGoodsInfos() {
        return goodsInfos;
    }

    public void setGoodsInfos(Set<GoodsInfo> goodsInfos) {
        this.goodsInfos = goodsInfos;
    }

    public Set<ShipType> getShipTypes() {
        return shipTypes;
    }

    public void setShipTypes(Set<ShipType> shipTypes) {
        this.shipTypes = shipTypes;
    }

    // Property accessors
}